﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
/// Form header represents hader of form/detail used in SCRUM agenda
/// </summary>
public partial class FormHeader : System.Web.UI.UserControl
{

    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    /// <summary>
    /// Gets or sets the text of the Header
    /// </summary>
    /// <value>The text.</value>
    public string Text 
    {
        get { return this.DetailHeader.Text; }
        set { this.DetailHeader.Text = value; }
    }

    /// <summary>
    /// Sets the last changed date of detailed object.
    /// </summary>
    /// <value>The last change.</value>
    public DateTime LastChange
    {
        set 
        {
            if (value != DateTime.MinValue)
            {
                string format = (string)GetGlobalResourceObject("GlobalStrings", "DateTimeFormatString");
                string label = (string)GetLocalResourceObject("LastChange");
                string date = String.Format(format, value);
                //this.LiteralLastChange.Text = String.Format(label, date);
                this.LiteralLastChange.Text = String.Format("{0}",date);
            }
            else
            {
                this.LiteralLastChange.Text = "";
            }
        }
    }

    /// <summary>
    /// Gets or sets the validation group for input
    /// </summary>
    /// <value>The validation group.</value>
    public string ValidationGroup
    {
        get
        {
            return this.DetailValidationSummary.ValidationGroup;
        }
        set
        {
            this.DetailValidationSummary.ValidationGroup = value;
        }
    }

    /// <summary>
    /// Gets the validation summary.
    /// </summary>
    /// <value>The validation summary.</value>
    public ValidationSummary ValidationSummary
    {
        get { return this.ValidationSummary; }
    }

}
